<template>
  <div>
     <breadcrumb></breadcrumb>
    <!-- 分割线 -->
    <el-divider content-position="left">未审核列表</el-divider>
    <template>
      <el-table
        :data="store.result"
        style="width: 100%">
        <el-table-column
          prop="store_id"
          label="编号"
          align="center"
          width="100">
        </el-table-column>
        <el-table-column
          prop="Chinese"
          label="店铺名称"
          align="center"
          width="180"
         >
        </el-table-column>
        <el-table-column
          label="店铺图片"
          width="150">
          <template slot-scope="scope">
            <img :src=" scope.row.img" alt="" width="60px">
          </template>
        </el-table-column>
        <el-table-column
          prop="TEL"
          label="电话号"
          align="center"
          width="150"
        >
        </el-table-column>
          <el-table-column  align="center" label="操作">
          <template slot-scope="scope">
            <el-button type="info" circle icon="el-icon-location-outline"  @click="moveTo(scope.$index)"></el-button>
            <el-button type="success" icon="el-icon-s-shop" circle  @click="$router.push(`/home/shop-details/${scope.row.store_id}`)" ></el-button>
            <el-button type="primary" icon="el-icon-edit" circle></el-button>
            <el-button type="danger" icon="el-icon-delete" circle></el-button>
          </template>           
        </el-table-column>
      </el-table>
    </template>
    <br>
    <!-- 分页 -->
    <el-pagination
      background
      :total=store.total
      :page-size=store.pagesize
      layout=" ->,prev, pager, next,total,jumper"
      @current-change="ChangCurrentPage"
    >
    </el-pagination>

 
    
  </div>
</template>

<script>
import breadcrumb from "../components/breadcrumb.vue";
import httpApi from "@/http";
  export default {
    components: { breadcrumb},
     data(){
        return{
          name:'',
          store:{
            page: 1,
            pagesize:5,
            result:[],
            total:1
          },
          imgnone: true,
        }
     },
     methods:{
        // 封装店铺列表
        liststore(){
          // let url = "http://localhost:3000/store/list?page=1&pagesize=100"
          let params = {page: this.store.page ,pagesize: this.store.pagesize}
          httpApi.storeApi.queryAllStoreList(params).then(res =>{
            console.log("店铺列表",res);
            this.store = res.data.data
            
          })
        },
         //变化当前页
         ChangCurrentPage(page){
            // console.log("当前页数",page);
            this.store.page = page
            this.search()
        },
      },

      // 页面挂载完毕后，发送请求，加载列表数据
      mounted(){
        //页面挂在完毕后，发送请求，加载列表数据
        this.liststore()
      }
  }
</script>

<style lang="scss" scoped>

</style>